home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue24 / appbar11 / APPBAR11.ZIP / APPBAR11.TXT < prev    next >
Encoding:
Text File  |  1997-07-03  |  5.6 KB  |  101 lines

  1. TAppBar Class v.1.1 for Delphi 2.0 and 3.0
  2. Copyright (c) 1997 Paolo Giacomuzzi
  3. e-mail: paolo.giacomuzzi@usa.net
  4. http://www.geocities.com/SiliconValley/9486
  5. -------------------------------------------
  6.  
  7.  
  8. PURPOSE
  9.  
  10. The TAppBar class is a TForm derived class, that lets your form to behave like an Application Desktop Toolbar.
  11.  
  12. "An application desktop toolbar (or an appbar for short) is a window that attaches itself to an edge of your screen. (The shellÆs taskbar window is a well-known example of an appbar).
  13. Though appbars are usually docked on an edge of the user's screen, they also can float. To make room for an appbar that's docked, the Windows 95/NT shell shrinks the size of the screen's workarea. The workarea is the portion of the screen that is not occupied by any appbars.
  14. Whenever the user maximizes a window, the system ensures that the window fills the workarea, not the full screen. If an appbar is docked on the edge of the screen, moved from one edge of the screen to another, or removed from an edge of the screen, the system automatically resizes and repositions any maximized windows so that they always fill the workarea completely. In addition, when the upper-left corner of the workarea changes, the system shifts all the application windows on the screen so that they always maintain their relative distance from that corner." (J. Richter, 'Extend the Windows 95 Shell with Application Desktop Toolbars', MSDN)
  15.  
  16.  
  17. USAGE
  18.  
  19. To add appbar behavior to your application, just derive the main form from TAppBar, as shown in the DEMOAPP.DPR sample. Then, use the following properties and methods to customize the appbar appearance, position, dimensions, and so on.
  20.  
  21.  
  22. PROPERTIES
  23.  
  24. * AlwaysOnTop : Boolean
  25. Always-On-Top On/Off. If it is True, the Appbar is always on top of all other windows. Recommended if AutoHide is True.
  26.  
  27. * AutoHide : Boolean
  28. Auto-hide On/Off. If it is True, the Appbar hides itself when focus is lost (just like the shell's taskbar).
  29.  
  30. * Edge : TAppBarEdge
  31. Edge to dock on. It can assume one of the following values: abeLeft, abeTop, abeRight, abeBottom, abeUnknown, abeFloat.
  32.  
  33. * Flags : TAppBarFlags
  34. Allowed dockable edges. It is a set of the following values: abfAllowLeft, abfAllowTop, abfAllowRight, abfAllowBottom, abfAllowFloat.
  35.  
  36. * HorzSizeInc : LongInt
  37. Horizontal increment when window is resized. A value of zero prevents the appbar to resize.
  38.  
  39. * VertSizeInc : LongInt
  40. Vertical increment when window is resized. A value of zero prevents the appbar to resize.
  41.  
  42. * DockDims : TRect
  43. AppBar dimensions when docked on left, top, right and bottom.
  44. DockDims.Left   - width  when docked on the left
  45. DockDims.Top    - height when docked on the top
  46. DockDims.Right  - width  when docked on the right
  47. DockDims.Bottom - height when docked on the bottom
  48.  
  49. * FloatRect : TRect
  50. Rectangle coordinates of the window when AppBar is floating.
  51.  
  52. * MinWidth  : LongInt
  53. Min allowed width when AppBar is floating.
  54.  
  55. * MinHeight : LongInt
  56. Min allowed height when AppBar is floating.
  57.  
  58. * MaxWidth  : LongInt
  59. Max allowed width when AppBar is floating.
  60.  
  61. * MaxHeight : LongInt
  62. Max allowed height when AppBar is floating.
  63.  
  64.  
  65. METHODS
  66.  
  67. * UpdateBar
  68. Forces the AppBar's visual appearance to match its internal state. Call this method after changing one or more properties.
  69.  
  70.  
  71. EVENTS (overridable functions)
  72.  
  73. * procedure OnAppBarStateChange (bProposed      : Boolean;
  74.                                  abEdgeProposed : TAppBarEdge); virtual;
  75. Called when the AppBar's state changes. Using this notification, it is possible to be notified when the appbar is going to change its state. If bProposed is True, the AppBar is being repositioned on an edge but not yet docked. If bProposed is False, the AppBar is definitively docked on a new edge. The abEdgeProposed argument indicates the edge the AppBar is being docked.
  76.  
  77. * procedure OnAppBarForcedToDocked; virtual;
  78. Called if the user attempts to dock an Autohide AppBar on an edge that already contains an Autohide AppBar.
  79.  
  80. * procedure OnABNFullScreenApp (bOpen : Boolean); virtual;
  81. Called when a fullscreen application is opened or closed. The bOpen argument contains True if a fullscreen window is opening and False if one is closing.
  82.  
  83. * procedure OnABNPosChanged; virtual;
  84. Called when any AppBar alters its size. This notification is also sent when an AppBar is removed, and when the shell's taskbar is in autohide mode and the user causes it to slide on or off the screen.
  85.  
  86. * procedure OnABNWindowArrange (bBeginning : Boolean); virtual;
  87. Called when the user chooses either the cascade, tile horizontally, or tile vertically options from the shell's taskbar. This notification is sent to each AppBar twice: the first time when the system is about to reposition all the windows (the bBeginning argument contains True), and the second time after that all the windows have been moved (the bBeginning argument contains False).
  88.  
  89.  
  90. DISCLAIMER
  91.  
  92. THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED "AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED. Because of the various software environments into which this class may be used, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
  93. Good data processing procedure dictates that any program based on this class be thoroughly tested with non-critical data before relying on it. THE USER MUST ASSUME THE ENTIRE RISK OF USING THE TAPPBAR CLASS.
  94.  
  95.  
  96. NOTES OF THE AUTHOR
  97.  
  98. * The TAppBar class is largely based on the J.Richter's CAppBar MFC Class.
  99. * TAppBar is completely FREEWARE.
  100. * Comments, suggestions and improvements are welcome.
  101.